package com.site.war.service.impl;

import java.util.List;
import java.util.Map;

import com.site.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.site.war.mapper.SiteWorkMapper;
import com.site.war.domain.SiteWork;
import com.site.war.service.ISiteWorkService;

/**
 * 工地基础信息Service业务层处理
 *
 * @author site
 * @date 2023-10-10
 */
@Service
public class SiteWorkServiceImpl implements ISiteWorkService
{
    @Autowired
    private SiteWorkMapper siteWorkMapper;

    /**
     * 查询工地基础信息
     *
     * @param id 工地基础信息主键
     * @return 工地基础信息
     */
    @Override
    public SiteWork selectSiteWorkById(Long id)
    {
        return siteWorkMapper.selectSiteWorkById(id);
    }

    /**
     * 查询工地基础信息列表
     *
     * @param siteWork 工地基础信息
     * @return 工地基础信息
     */
    @Override
    public List<SiteWork> selectSiteWorkList(SiteWork siteWork)
    {
        return siteWorkMapper.selectSiteWorkList(siteWork);
    }

    /**
     * 新增工地基础信息
     *
     * @param siteWork 工地基础信息
     * @return 结果
     */
    @Override
    public int insertSiteWork(SiteWork siteWork)
    {
        siteWork.setCreateTime(DateUtils.getNowDate());
        return siteWorkMapper.insertSiteWork(siteWork);
    }

    /**
     * 修改工地基础信息
     *
     * @param siteWork 工地基础信息
     * @return 结果
     */
    @Override
    public int updateSiteWork(SiteWork siteWork)
    {
        return siteWorkMapper.updateSiteWork(siteWork);
    }

    /**
     * 批量删除工地基础信息
     *
     * @param ids 需要删除的工地基础信息主键
     * @return 结果
     */
    @Override
    public int deleteSiteWorkByIds(Long[] ids)
    {
        return siteWorkMapper.deleteSiteWorkByIds(ids);
    }

    /**
     * 删除工地基础信息信息
     *
     * @param id 工地基础信息主键
     * @return 结果
     */
    @Override
    public int deleteSiteWorkById(Long id)
    {
        return siteWorkMapper.deleteSiteWorkById(id);
    }

    @Override
    public List<Map<String, Object>> getProjectNumberTrend() {
        return siteWorkMapper.getProjectNumberTrend();
    }

    @Override
    public int getAllCount() {
        return siteWorkMapper.getAllCount();
    }

    @Override
    public List<Map<String, Object>> getWorkListByStreet(String street) {
        return siteWorkMapper.getWorkListByStreet(street);
    }

    @Override
    public List<Map<String, Object>> getWorkBySiteNumber(String street) {
        return siteWorkMapper.getWorkBySiteNumber(street);
    }

    @Override
    public List<Map<String, Object>> getWarningCollect() {
        return siteWorkMapper.getWarningCollect();
    }

    @Override
    public List<Map<String, Object>> getWorkCollect() {
        return siteWorkMapper.getWorkCollect();
    }
}
